package com.vastcom.provider.comsume;

import com.vastcom.provider.model.UserInfo;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
@EnableJms
public class MessageConsumer {


    @JmsListener(destination = "helloworld-queue")
    public void messageListener(String message){
        System.out.printf("ReceiveMessage  "+message);
    }

    @JmsListener(destination = "object-queue")
    public void ObjectMessageListener(UserInfo userInfo){
        System.out.printf("用户名 " + userInfo.getUsername());
        System.out.printf("password "+userInfo.getPassword() );
        System.out.printf("birth"+userInfo.getLastlogin());
    }
}
